package com.xiyi.shouxin.entity.user.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;
import org.springframework.lang.Nullable;

import com.xiyi.shouxin.entity.user.Music;

public class MusicMapper implements RowMapper<Music> {
    @Override
    @Nullable
    public Music mapRow(@Nullable ResultSet rs, int rowNum) throws SQLException {
        Music music = new Music();
        if (rs == null) {
            return music;
        }
        music.setId(rs.getLong("id"));
        music.setName(rs.getString("name"));
        music.setThumb(rs.getString("thumb"));
        music.setUrl(rs.getString("url"));
        music.setStatus(rs.getInt("status"));
        music.setCreatedAt(rs.getTimestamp("created_at"));
        return music;
    }
}
